﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Summer.IService;

namespace Summer.WebApi.Api
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProductController : ControllerBase
    {
        private readonly IProductService _baseService;
        public ProductController(IProductService baseService)
        {
            _baseService = baseService;
        }

        [HttpGet]
        public async Task<string> Get(string productType = "A")
        {
            var product = _baseService.GetAllProductsAsync(productType);
            return product;
        }
    }
}